package org.mspring.mlog.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.mspring.mlog.dao.CodeBookDao;
import org.mspring.mlog.entity.CodeBook;
import org.mspring.mlog.entity.Post;
import org.springframework.stereotype.Repository;

@Repository
@SuppressWarnings("unchecked")
public class CodeBookDaoImpl extends BaseDaoImpl implements CodeBookDao {

	@Override
	public List<CodeBook> getCodeBookByType(String type) {
		// 初始化连接
		SqlSession sqlSession = getSqlSession();
		// 执行sql
		CodeBook cb = new CodeBook();
		cb.setType(type);
		List<CodeBook> list = (List<CodeBook>) sqlSession.selectList(
				"todoWidgetAct.getCodeBookByType", cb);

		// 断开连接
		sqlSession.close();

		return list;
	}

}
